package de.hs_mannheim.visualscheduler.scheduling;

/**
 * The Class ProcessResult extends a ProcessDefinitions by time counts.
 */
public final class ProcessResult extends ProcessDefinition {
	private static final long	serialVersionUID	= -4310775071475713386L;
	int							active				= 0;
	int							latency				= 0;
	int							sleep				= 0;

	/**
	 * Instantiates a new process result.
	 * 
	 * @param processDefinition
	 *            of the process this result is for
	 */
	public ProcessResult(final ProcessDefinition processDefinition) {
		super(processDefinition.getRuntime(), processDefinition.getArrival(), processDefinition.getPriority(), processDefinition.getName());
	}

	/**
	 * Gets the active time. This is the time the process was running for.
	 * 
	 * @return the active time
	 */
	public int getActive() {
		return active;
	}

	/**
	 * Gets the latency. This is the time between the start of the Process and the first active timeslice
	 * 
	 * @return the latency
	 */
	public int getLatency() {
		return latency;
	}

	/**
	 * Gets the sleep. The Process sleeps when it enters the wait state after it was active.
	 * 
	 * @return the sleep time
	 */
	public int getSleep() {
		return sleep;
	}
}
